(function ({form,table,layer,laydate,radioAndAelectData,url,vteamid,vfactoryflg,vappraiseflg,contentType,ok,AjaxFn,vpositionid,vpositionname}) {

    (()=>(res = AjaxFn(url+"radioAndAelectData",'',{}),{factorys='',appraises='',o=''}=res, factorys.length>0&&factorys!=''?($.each(factorys,(i,v)=>(o += `<option value="${factorys[i].scode}">${factorys[i].vname}</option>`)),$("select[name=vFactoryFlg]").html(o).val(vfactoryflg)):'', appraises.length>0&&appraises!=''?(o='',$.each(appraises,(i,v)=>(checked = v.scode==vappraiseflg?"checked":'', o += `<input type="radio" ${checked} name="vAppraiseFlg" value="${appraises[i].scode}" title="${appraises[i].vname}">`)),$("#vAppraiseFlgRadio").html(o)):'',radioAndAelectData = res))(),form.render(),

    form.on("submit(teamUpdata)",function ({field}) {
        field.vTeamName = field.vTeamName.trim()
        let {msg,code} = AjaxFn(url+"teamUpdata",JSON.stringify(field),{}) ;
        code==200?ok(msg,1):layer.msg(msg,{icon: 5});
        return false;
    })

})({
    form: layui.form,
    table: layui.table,
    layer: layui.layer,
    laydate:layui.laydate,
    radioAndAelectData:{},
    url: "/evaluation/positionAndTeam/",
    vteamid:$("input[name=vteamid]").val(),
    vfactoryflg:$("input[name=factoryflg]").val(),
    vappraiseflg:$("input[name=appraiseflg]").val(),
    contentType: 'application/json;charset=utf-8',
    ok:function(msg,icon){
        layui.layer.confirm(msg, {
            id: "ok",
            icon: icon,
            anim: 4,
            title: '提示',
            btn: ['确定'],
            closeBtn:false,
            success: function (layero) {
                var btn = layero[0].getElementsByClassName('layui-layer-btn')[0].getElementsByTagName('A')[0];
                btn.href = 'javascript:void(0)';
                btn.focus();
            },
            yes: function(index, layero){
                layer.close(index); //再执行关闭
            },
            end:function () {
                var index2 = parent.layer.getFrameIndex(window.name);
                parent.layer.closeAll();
            }
        });
    },
    AjaxFn:function (url,data,resource) {
        $.ajax({
            url,
            contentType:'application/json;charset=utf-8',
            type:'post',
            async:false,
            data,
            success:function(res) {
                let {msg='',code=''} =res;
                msg=='' && code==''? top.location.reload() : "";
                resource = res;
            }
        });
        return resource;
    },
})